package com.duan.laugh.rocketmq;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class Controller {

//    @Autowired
//    private RocketTemplate rocketMQTemplate;
//    @GetMapping
//    public void send(){
//        rocketMQTemplate.asyncSend("test-topic",null,null);
//    }

    @Autowired
    private SimpMessagingTemplate messagingTemplate;
    @GetMapping("send/socket")
    public void sendWebSocket(){
        messagingTemplate.convertAndSendToUser("one","message","3");

    }
}
